
open Default, "<.\\log20130611-NoSendingFalseWakeups\\default.log" or die"cannot open .\\log20130611-NoSendingFalseWakeups\\default.log\n";
open IACCA, "<.\\log20130611-NoSendingFalseWakeups\\IACCA.log" or die"cannot open .\\log20130611-NoSendingFalseWakeups\\IACCA.log\n";

@default[300];
@IACCA[300];
@IMD[300];

$numDef = 0;
$numIACCA = 0;
$numIMD = 0;

while(<Default>){
	chomp;
	@rs = split;

	$default[$numDef++] = $rs[0];
}

while(<IACCA>){
	chomp;
	@rs = split;

	$IACCA[$numIACCA++] = $rs[0];
}

$numIMD = $numIACCA<$numDef? $numIACCA : $numDef;
print $numIMD;

close IACCA;
close Default;

open Output, ">.\\log20130611-NoSendingFalseWakeups\\total.log" or die "cannot open .\\log20130611-NoSendingFalseWakeups\\total.log\n";
for($i=0;$i<$numIMD;$i++) {
	$IMD[$i] = $default[$i] - $IACCA[$i];
	print "$IMD[$i]\n";
	print Output "$IMD[$i]\n";
}
close Output;
